import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/giveInfo/queryPage',
    method: 'post',
    data
  })
}

/**
 * 查询详情
 * @param {*} id
 */
export function get(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/get',
    method: 'get',
    params: { id }
  })
}

/**
 * 添加福利包
 * @param {*} data
 */
export function insert4Account(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/insert',
    method: 'post',
    data
  })
}

/**
 * 编辑福利包
 * @param {*} data
 */
export function update4Account(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/update',
    method: 'post',
    data
  })
}

/**
 * 添加
 * @param {*} data
 */
export function insert4Coupon(data, t) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/insertForShop',
    method: 'post',
    data
  })
}

/**
 * 编辑
 * @param {*} data
 */
export function update4Coupon(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/update',
    method: 'post',
    data
  })
}

/**
 * 删除
 * @param {*} id
 */
export function del(ids) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/deleteByIds',
    method: 'get',
    params: { ids }
  })
}

export function queryAccount(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/childAccount/queryItemList',
    method: 'post',
    data
  })
}
export function queryJd(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/jdActivity/query',
    method: 'post',
    data
  })
}

/**
 * 获取兑换券列表
 * @param data
 */
export function queryCoupons(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/shopCoupons/queryPageCoupons',
    method: 'post',
    data
  })
}

/**
 * 修改状态
 * @param {*} data
 */
export function updatePublishStatus(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/giveInfo/updatePublishStatus',
    method: 'post',
    data
  })
}
/**
 * 获取出金账户
 * @param {*} data
 * @returns
 */
export function getAcc(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/account/getExpenditureAccount',
    method: 'post',
    data
  })
}
export function getRechOne(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/recharge/getOneList',
    method: 'post',
    data
  })
}

/**
 * 获取入金账户
 * @param {*} data
 * @returns
 */
export function getAccIn(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/account/getIncomeAccount',
    method: 'post',
    data
  })
}
export function getRech(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/recharge/getRecharge',
    method: 'post',
    data
  })
}
export function getJdRech(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/recharge/getRechargeJD',
    method: 'post',
    data
  })
}
/*
 商城专区
 */
export function getSczq(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/shopCoupons/queryPageShopPrefecture',
    method: 'post',
    data
  })
}
/*
 商城兑换券
 */
export function getYhq(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: ' /backend/shopCoupons/queryPageCoupons',
    method: 'post',
    data
  })
}
/**
	* 专区详情
	*/
export function getZqInfo(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/shopCoupons/getShopPrefecture',
    method: 'post',
    data
  })
}

/**
 	* 兑换券详情
 	*/
export function getDhqInfo(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/shopCoupons/getCoupons',
    method: 'post',
    data
  })
}

